<?php
/**
 * File : DBTranslator.php
 * Created by Ludovic Reenaers
 * Created on  4 nov. 2010
 * lreenaers@hotmail.com
 */
class DBTranslator{
	private $daoFactory;
	private $translations;
	public function __construct($daoFactory){
		$this->daoFactory = $daoFactory;
		$translationDAO = $this->daoFactory->getTranslationDAO();

		$this->translations = $translationDAO->getAllByIso($_SESSION['langue']);
	}
	public function getLabel($name){
		$label="NULL!!";
		foreach ($this->translations as $Translation) {
			if($Translation->getName()==$name){
				$label=$Translation->getLabel();
			}
		}
		return $label;
	}
	public function __get($Name)
	{
		return $this->getLabel($Name);
	}
}
?>